package com.chushouya.manager.constants;

import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Numbers;

import java.util.Objects;

public enum MerchantRoleTypeEnum implements IEnum<Integer> {
    manager(Numbers.INTEGER_ZERO, "回收商负责人"),
    quotation(Numbers.INTEGER_ONE, "报价师");

    private Integer value;

    private String desc;


    MerchantRoleTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (MerchantRoleTypeEnum thisEnum : MerchantRoleTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return "";
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
